﻿/* Copyright Rex All rights reserved. */
enyo.kind({
	name: "com.RexToy.anglView",
	kind: com.RexToy.abstractCvtView,
	components: [
		{kind: "BasicScroller", components: [
			{kind: "RowGroup", components:[
				{name: "d", richContent: false, kind: "Input", onblur:"blur", components: [
					{className: "hint", content: $L("Degree")}
				]},
				{name: "r", richContent: false, kind: "Input", onblur:"blur", components: [
					{className: "hint", content: $L("Radian")}
				]},
				{name: "g", richContent: false, kind: "Input", onblur:"blur", components: [
					{className: "hint", content: $L("Gradian")}
				]}
			]}
		]}
      ],	  
	
	fomular: {
		"d->d": "d",
		"d->r": "d/180*3.1416",
		"r->d": "r*180/3.1416",
		"d->g": "d/360*400",
		"g->d": "g/400*360"
	},
	
	units: ["d","r","g"],
	baseUnit: "d",
	
	blur: function(sender)
	{
		if(this.isNumber(sender))
		{
			this.calc(sender.name, this.getNumber(sender));
		}
	}
});